Page({

  /**
   * 页面的初始数据
   */
  data: {
    UserImage: '',
    Username: '',
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var _this=this
    wx.getUserInfo({
      success:function(res){
        _this.setData({
          UserImage: res.userInfo.avatarUrl,
          Username: res.userInfo.nickName
        })
      }
    })
  },
  about:function(){
    wx.navigateTo({
      url: '../../pages/about/about' ,
    })
  },
  openResume:function(){
    wx.navigateTo({
      url: '../../pages/resumedetail/resumedetail',
    })
  },
  openRecord:function(){
    wx.navigateTo({
      url: '../../pages/record/record',
    })
  },
  openCollect:function(){
    wx.navigateTo({
      url: '../../pages/collect/collect',
    })
  },
  openIdea:function(){
    wx.navigateTo({
      url: '../../pages/idea/idea',
    })
  },
  getPhoneNumber:function(e){
    console.log(e.detail.errMsg)
    console.log(e.detail.iv)
    console.log(e.detail.encryptedData)   
    if (e.detail.errMsg == 'getPhoneNumber:fail user deny') {
      wx.showModal({
        title: '提示',
        showCancel: false,
        content: '未授权',
        success: function (res) { }
      })
    } else {
      wx.showModal({
        title: '提示',
        showCancel: false,
        content: '同意授权',
        success: function (res) { }
      })
    }  

  },
  toLogin:function(e){
    wx.navigateTo({
      url: '/pages/login/login',
    })
  }


})